package com.dodock.banglapapers.server.generator;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.dodock.banglapapers.server.helper.DDNNewsListBBCBangla;
import com.dodock.banglapapers.server.helper.DDNNewsListBDProtidin;
import com.dodock.banglapapers.server.helper.DDNNewsListBanglanews24;
import com.dodock.banglapapers.server.helper.DDNNewsListBdnews;
import com.dodock.banglapapers.server.helper.DDNNewsListDW;
import com.dodock.banglapapers.server.helper.DDNNewsListInqilab;
import com.dodock.banglapapers.server.helper.DDNNewsListIttefaq;
import com.dodock.banglapapers.server.helper.DDNNewsListKalerKantho;
import com.dodock.banglapapers.server.helper.DDNNewsListManobZamin;
import com.dodock.banglapapers.server.helper.DDNNewsListPoriborton;
import com.dodock.banglapapers.server.helper.DDNNewsListProthomalo;
import com.dodock.banglapapers.server.helper.DDNNewsListSamakal;

public class DDNGetNewsListGenerator {

	private String newspapaerid;
	private String categoryid;
	
	public DDNGetNewsListGenerator(String newspaperid, String categoryid){
		this.newspapaerid = newspaperid;
		this.categoryid = categoryid;
	}
	
	public String Generate() throws IOException, SAXException, ParserConfigurationException{
		if(newspapaerid.equalsIgnoreCase("prothomalo")){
			DDNNewsListProthomalo gen = new DDNNewsListProthomalo();
			return gen.GenerateNewsList(categoryid);
		}
		else if(newspapaerid.equalsIgnoreCase("bdnews24")){
			DDNNewsListBdnews gen = new DDNNewsListBdnews();
			return gen.GenerateNewsList(categoryid, "bn");
		}
		else if(newspapaerid.equalsIgnoreCase("bdnewsenglish24")){
			DDNNewsListBdnews gen = new DDNNewsListBdnews();
			return gen.GenerateNewsList(categoryid, "en");
		}
		else if(newspapaerid.equalsIgnoreCase("bbcbangla")){
			DDNNewsListBBCBangla gen = new DDNNewsListBBCBangla();
			return gen.GenerateNewsList(categoryid);
		}
		else if(newspapaerid.equalsIgnoreCase("dw")){
			DDNNewsListDW gen = new DDNNewsListDW();
			return gen.GenerateNewsList(categoryid);
		}
		else if(newspapaerid.equalsIgnoreCase("manobzamin")){
			DDNNewsListManobZamin gen = new DDNNewsListManobZamin();
			return gen.GenerateNewsList(categoryid);
		}
		else if (newspapaerid.equalsIgnoreCase("samakal")) {
			DDNNewsListSamakal gen = new DDNNewsListSamakal();
			return gen.GenerateNewsList(categoryid);
		}
		else if (newspapaerid.equalsIgnoreCase("kalerkantho")) {
			DDNNewsListKalerKantho gen = new DDNNewsListKalerKantho();
			return gen.GenerateNewsList(categoryid);
		}else if (newspapaerid.equalsIgnoreCase("banglanews24")) {
			DDNNewsListBanglanews24 gen = new DDNNewsListBanglanews24();
			return gen.GenerateNewsList(categoryid);
		}else if (newspapaerid.equalsIgnoreCase("ittefaq")) {
			DDNNewsListIttefaq gen = new DDNNewsListIttefaq();
			return gen.GenerateNewsList(categoryid);
		}else if (newspapaerid.equalsIgnoreCase("inqilab")) {
			DDNNewsListInqilab gen = new DDNNewsListInqilab();
			return gen.GenerateNewsList(categoryid);
		}else if (newspapaerid.equalsIgnoreCase("poriborton")) {
			DDNNewsListPoriborton gen = new DDNNewsListPoriborton();
			return gen.GenerateNewsList(categoryid);
		}else if (newspapaerid.equalsIgnoreCase("bd_protidin")) {
			DDNNewsListBDProtidin gen = new DDNNewsListBDProtidin();
			return gen.GenerateNewsList(categoryid);
		}
		return "[]";
	}
	
	
	public String getNewspapaerid() {
		return newspapaerid;
	}
	public void setNewspapaerid(String newspapaerid) {
		this.newspapaerid = newspapaerid;
	}
	public String getCategoryid() {
		return categoryid;
	}
	public void setCategoryid(String categoryid) {
		this.categoryid = categoryid;
	}
	
	
	
	
}
